<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div class="getbaidu">asdf</div>
<script>
    $(".getbaidu").on("click",function() {
        var data = {data: "aaaaaa"};
        alert(data);
        $.ajax({
            type: "POST",
            url: "http://127.0.0.1:5000/set",
            data: data,
            datatype: "json",
            success: function (data) {
                alert(data)
            },
            error: function (e) {
                alert("error:" + e);
            }
        })
    };

</script>
</body>
</html>